﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Tea.Parser {

    /// <summary>
    /// 默认的使用控制台的错误报告工具。
    /// </summary>
    public class DefaultErrorReporter : IErrorReporter {

        #region IErrorReporter 成员

        public void Error(string message, Location startLocation, Location endLocation) {
            ErrorCount++;
            //Logger.Error("{0} [{1}  {2}]", message, startLocation, endLocation);
        }

        public void Warning(string message, Location startLocation, Location endLocation) {
            WarningCount++;
            //Logger.Warning("{0} [{1}  {2}]", message, startLocation, endLocation);
        }

        public void WarningStrict(string message, Location startLocation, Location endLocation) {
            WarningCount++;
            //Logger.Error("{3}: {0} [{1}  {2}]", message, startLocation, endLocation, Messages.StrictModeName);
        }

        public void Clear() {
            WarningCount = ErrorCount = 0;
        }

        public int WarningCount {
            get;
            set;
        }

        public int ErrorCount {
            get;
            set;
        }

        #endregion
    }
}
